package com.wl2o2o.basic;

import java.util.Scanner;

public class HexToDecimal {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		String num = scanner.next();
		//16转换为十进制
		int a = Integer.parseInt(num, 16);
		System.out.println(a);
		scanner.close();
	}

}